<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>部门管理</title>
    <link rel="stylesheet" href="../../component/pear/css/pear.css" />
    <link rel="stylesheet" href="../../admin/css/other/department.css" />
    <link rel="stylesheet" href="../../admin/css/other/console1.css" />
    <link rel="stylesheet" href="../../admin/css/other/console2.css" />
</head>
<style>
    .act {
        background-color: #bdc3c7;
    }
</style>

<body class="pear-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">爬取记录</div>
                <div class="layui-card-body" style="height: 500px;">
                    <dl class="layuiadmin-card-status">
                        <dd>
                            <div class="layui-status-img"><a href="javascript:;"><img
                                        style="width: 32px;height: 32px;border-radius: 50px;"
                                        src="../../admin/images/pachong.png"></a></div>
                            <div>
                                <p>汽车之家-买车用车-采集</p>
                                <p><span>数据条数：5632</span></p>
                                <p><span>爬取时间：一天前</span>
                                    <a href="javascript:;" data-id="1"
                                        class="pear-btn pear-btn-primary pear-btn-xs pear-reply"
                                        style="margin-right: 100px;">查看</a>
                                    <a href="javascript:;" data-id="1" class="pear-btn  pear-btn-xs pear-reply"
                                        style="margin-right: 50px;background-color: rgb(1, 170, 237);color: white;">预测</a>
                                    <a href="javascript:;" data-id="1"
                                        class="pear-btn pear-btn-danger pear-btn-xs pear-reply">删除</a>
                                </p>
                            </div>
                        </dd>
                        <dd>
                            <div class="layui-status-img"><a href="javascript:;"><img
                                        style="width: 32px;height: 32px;border-radius: 50px;"
                                        src="../../admin/images/pachong.png"></a></div>
                            <div>
                                <p>易车网-买车更放心-采集</p>
                                <p><span>数据条数：1576</span></p>
                                <p><span>爬取时间：2021/3/18</span>
                                    <a href="javascript:;" data-id="1"
                                        class="pear-btn pear-btn-danger pear-btn-xs pear-reply">删除</a>
                                </p>
                            </div>
                        </dd>
                        <dd>
                            <div class="layui-status-img"><a href="javascript:;"><img
                                        style="width: 32px;height: 32px;border-radius: 50px;"
                                        src="../../admin/images/pachong.png"></a></div>
                            <div>
                                <p>懂车帝-看车价真实-采集</p>
                                <p><span>数据条数：7542</span></p>
                                <p><span>爬取时间：2021/1/19</span>
                                    <a href="javascript:;" data-id="1"
                                        class="pear-btn pear-btn-danger pear-btn-xs pear-reply">删除</a>
                                </p>
                            </div>
                        </dd>
                        <dd>
                            <div style="width: 100%;">
                                <button id="click" class="pear-btn pear-btn-primary layui-btn-fluid" lay-event="add">
                                    <i class=" layui-icon layui-icon-add-1"></i>
                                    新增爬取项目
                                </button>
                            </div>
                        </dd>
                    </dl>
                </div>
            </div>
        </div>
        <div class="layui-col-md8">
            <div class="layui-card">
                <div class="layui-card-body">
                    <table id="organization-table" lay-filter="organization-table"></table>
                </div>
            </div>
        </div>
    </div>

    <script type="text/html" id="organization-toolbar">
		<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
			<i class="layui-icon layui-icon-add-1"></i>
			新增
		</button>
		<button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
			<i class="layui-icon layui-icon-delete"></i>
			删除
		</button>
	</script>

    <script type="text/html" id="organization-bar">
			<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i
				class="layui-icon layui-icon-edit"></i></button>
		    <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i
				class="layui-icon layui-icon-delete"></i></button>
	    </script>
    <script src="../../component/layui/layui.js"></script>
    <script src="../../component/pear/pear.js"></script>
    <script>
        layui.use(['table', 'form', 'jquery', 'dtree'], function () {
            let table = layui.table;
            let form = layui.form;
            let $ = layui.jquery;
            let dtree = layui.dtree;

            let MODULE_PATH = "operate/";

            let cols = [
                [{
                    title: '序号',
                    field: 'id',
                    align: 'center',
                    width: 80
                }, {
                    title: '评论',
                    field: 'content',
                    width: 300
                },
                {
                    title: '车名',
                    field: 'carname',
                    align: 'center'
                },
                {
                    title: '车型',
                    field: 'carmodel',
                    align: 'center',
                    width: 200
                },
                {
                    title: '评论日期',
                    field: 'date',
                    align: 'center'
                }]
            ]
            $('#click').click(function () {
                // top.layui.tab.addTabOnlyByElem("content", {
                //     id: "111", title: "爬取设置", url: "view/document/step.html", close: "允许关闭"
                // });
                window.location.href = "../../view/document/step.html"
            });
            table.render({
                elem: '#organization-table',
                url: '../../admin/data/organization.json',
                height: 'full-150',
                page: true,
                cols: cols,
                skin: 'line',
                toolbar: '#user-toolbar',

            });

            table.on('tool(organization-table)', function (obj) {
                if (obj.event === 'remove') {
                    window.remove(obj);
                } else if (obj.event === 'edit') {
                    window.edit(obj);
                }
            });

            table.on('toolbar(organization-table)', function (obj) {
                if (obj.event === 'add') {
                    window.add();
                } else if (obj.event === 'refresh') {
                    window.refresh();
                } else if (obj.event === 'batchRemove') {
                    window.batchRemove(obj);
                }
            });

            form.on('submit(organization-query)', function (data) {
                table.reload('organization-table', {
                    where: data.field
                })
                return false;
            });
            window.refresh = function (param) {
                table.reload('organization-table');
            }
        })
    </script>
</body>

</html>